package com.united.ucts.modules.system.pojo.po;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.united.frame.common.module.pojo.po.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 用户基本信息数据库对象
 *
 * @author hudan
 * @version 1.0
 * @filename Admin.java
 * @copyright <a href="www.chancein.com">www.chancein.com</a>
 * @date 2021-03-01
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@TableName(value = "ums_admin")
public class Admin extends BaseEntity {

    /** 登录用户 */
    private String username;
    /** 登录密码 */
    private String password;
    /** 头像 */
    private String icon;
    /** 邮箱 */
    private String email;
    /** 昵称 */
    private String nickName;
    /** 备注信息 */
    private String note;
    /** 最后登录时间 */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime loginTime;
    /** 生效标识(0:未生效;1:已生效) */
    @TableField(value = "status", fill = FieldFill.INSERT)
    protected Integer status;
}